# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=ip-tracer
pkgver=92.6b9c454
pkgrel=1
pkgdesc='Track and retrieve any ip address information.'
arch=('any')
groups=('blackarch' 'blackarch-recon')
url='https://github.com/Rajkumrdusad/IP-Tracer'
license=('MIT')
depends=('bash' 'php')
makedepends=('git')
source=("$pkgname::git+https://github.com/Rajkumrdusad/IP-Tracer.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/opt/$pkgname"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  cp -a --no-preserve=ownership * "$pkgdir/opt/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /opt/$pkgname
exec bash trace "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

